<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0px;
            padding: 0px;
        }

        ul {
            top: 200px;
            left: 500px;
        }

        ul>li,
        ul {
            position: absolute;

            width: 100px;
            height: 100px;
        }

        ul {
            transform-style: preserve-3d;
            list-style: none;

        }

        ul:hover {
            transform: rotatex(3600deg) rotateY(3600deg) rotateZ(3600deg);
            transition: 20s;
        }

        .left {
            background-color: aqua;
            transform-origin: left;
            transform: rotateY(90deg);
        }

        .right {
            background-color: red;
            transform-origin: right;
            transform: rotateY(-90deg);
        }

        .top {
            background-color: yellow;
            transform-origin: top;
            transform: rotatex(-90deg);

        }

        .bottom {
            background-color: rgb(167, 167, 167);
            transform-origin: bottom;
            transform: rotatex(90deg);

        }

        .front {
            background-color: rgb(233, 39, 233);

        }

        .behind {
            background-color: rgb(16, 20, 224);
            transform: translateZ(-100px);

        }
    </style>
</head>

<body>
    <ul>
        <li class="left"></li>
        <li class="right"></li>
        <li class="top"></li>
        <li class="bottom"></li>
        <li class="front"></li>
        <li class="behind"></li>
    </ul>

</body>

</html>